package com.power.sifa.approve.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.plf.core.common.annotations.FieldEnumText;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
*  典型案件收藏表实体类
*/

@Entity
@ApiModel(value="典型案件收藏表")
@Data
@Table(name="Apl_typical_case",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Apl_typical_case.Apl_typical_casePK.class) 用于复合组件
public class Apl_typical_case extends BaseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "序号")
    private String id;

    @ApiModelProperty(value = "申请人")
    private String applyname;

    @ApiModelProperty(value = "被申请人")
    private String targetname;

    @ApiModelProperty(value = "案由")
    private String casecause;

    @ApiModelProperty(value = "标签")
    private String classify;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "创建人id")
    private String createuserid;

    @ApiModelProperty(value = "创建人名称")
    private String createusername;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createtime;

    @ApiModelProperty(value = "案件id")
    private String applyid;

    @ApiModelProperty(value = "案号")
    private String acceptcode;

    /**
     * 流程实例id
     */
    @Transient
    private String instid;
    /**
     * 相似度
     */
    @Transient
    private Double similary;

    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("applyname", this.getApplyname());
        map.put("targetname", this.getTargetname());
        map.put("casecause", this.getCasecause());
        map.put("classify", this.getClassify());
        map.put("remarks", this.getRemarks());
        map.put("createuserid", this.getCreateuserid());
        map.put("createusername", this.getCreateusername());
        map.put("createtime", this.getCreatetime());
        map.put("applyid", this.getApplyid());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_typical_casePK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_typical_casePK pk = (Apl_typical_casePK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}